using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using RealState.BusinessObjects;
using RealState.DAL;

namespace RealState.BLL
{
	public class UsersBLL
	{
		private UsersDAO _UsersDAO;

		public UsersDAO UsersDAO
		{
			get { return _UsersDAO; }
			set { _UsersDAO = value; }
		}

		public UsersBLL()
		{
			UsersDAO = new UsersDAO();
		}
		public List<Users> GetUserss()
		{
			try
			{
				return UsersDAO.GetUserss();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Users GetUsers(int Id)
		{
			try
			{
				return UsersDAO.GetUsers(Id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddUsers(Users oUsers)
		{
			try
			{
				return UsersDAO.AddUsers(oUsers);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateUsers(Users oUsers)
		{
			try
			{
				return UsersDAO.UpdateUsers(oUsers);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
        public int UpdateUsers_2(Users oUsers)
        {
            try
            {
                return UsersDAO.UpdateUsers_2(oUsers);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
		public int RemoveUsers(Users oUsers)
		{
			try
			{
				return UsersDAO.RemoveUsers(oUsers);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveUsers(int Id)
		{
			try
			{
				return UsersDAO.RemoveUsers(Id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Users> DeserializeUserss(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Users>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeUserss(string Path, List<Users> Userss)
		{
			try
			{
				GenericXmlSerializer<List<Users>>.Serialize(Userss, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
